<?php
class Validates {
    public static function email($email,$flag = false){
        if(!preg_match('/^[_A-z0-9-]+((\.|\+)[_A-z0-9-]+)*@[A-z0-9-]+(\.[A-z0-9-]+)*(\.[A-z]{2,4})$/',$email))
            $flag = true;
        return $flag;
    }
    public static function phone($number, $is_phone = true , $flag = false){
        $pattern = ($is_phone==true) ? '#^0[0-9]{6,10}$#' : '#[0-9]{6,10}$#';
        if(!preg_match($pattern,$number))
                $flag = true;
        return $flag;
    }
}

?>